home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 May / 1984-05.d64 / fast add_64 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  75 lines

  1. 1 dima%(2),b%(2),c%(3),r%(3),p%(5),n%(12,3,3):t%=40:v=54296:s1=54272:i=rnd(-ti)
  2. 5 cs=55296:s%=1024
  3. 7 forl=s1tos1+24:pokes1,0:nextl:pokev,15:pokes1+5,17:pokes1+6,241
  4. 10 print"[147]"tab(56)"fastadd":printtab(91)"1, 2, or 3 digits?":gosub400
  5. 15 geta$:ifa$=""ora$<"1"ora$>"3"then15
  6. 20 l%=val(a$):q%=9+l%*2
  7. 25 pb%=0:pr%=0:pa%=0
  8. 30 gosub100:w%=0:fori=0tog%:w%=w%+c%(i)*10^i:next:gosub200:gosub300:fori=1to1000:next
  9. 35 ifu%=w%thenpr%=pr%+1:goto55
  10. 40 poke53281,0:print"[147]"tab(136);"w r o n g":printtab(55)"the correct"
  11. 45 printtab(56)"answer is":fori=1to2000:next:gosub200
  12. 50 y%=14:form=0tog%:x%=q%-m*4+8:z%=c%(m):gosub500:next:fori=1to1000
  13. 53 next:xt%=30:goto65
  14. 55 fori=1to6:pokes1+4,33:pokes1+1,pi(i):fora=1todu(i):next:pokes1+4,32
  15. 60 forj=1to50:next:next
  16. 65 pb%=pb%+30-xt%:pa%=pa%+1:ifpa%<10then30
  17. 70 pr%=pr%*10:s$=str$(pr%):x1%=3-len(s$)*2:print"[147][144]":y%=3:h%=0
  18. 75 form=2tolen(s$):x%=x1%+m*4+8:z%=val(mid$(s$,m,1)):gosub500:next:pb%=pb%*l%
  19. 80 x%=x%+4:z%=12:gosub500
  20. 85 printtab(13)" timed score":s$=str$(pb%):x1%=5-len(s$)*2:y%=12:h%=2
  21. 90 form=2tolen(s$):x%=x1%+m*4+8:z%=val(mid$(s$,m,1)):gosub500:next
  22. 92 printtab(13)" hit any key"
  23. 94 geta$:ifa$=""then94
  24. 96 goto25
  25. 100 fori=0to2:a%(i)=0:b%(i)=0:c%(i)=0:r%(i)=0:next:r%(3)=0:c%(3)=0
  26. 110 fori=0tol%-1:a%(i)=int(10*rnd(1)):ifa%(i)<>0thene%=i
  27. 120 b%(i)=int(10*rnd(1)):ifb%(i)<>0thenf%=i
  28. 130 w%=a%(i)+b%(i)+r%(i):ifw%<10thenc%(i)=w%:g%=i:next:return
  29. 140 c%(i)=w%-10:r%(i+1)=1:next:c%(i)=1:g%=i:return
  30. 200 poke53281,1:poke53280,0:print"[147]":h%=0:y%=2:form=0toe%:x%=q%-m*4+8:z%=a%(m)
  31. 205 gosub 500:next
  32. 210 poke198,0:y%=7:form=0tof%:x%=q%-m*4+8:z%=b%(m):gosub500:next
  33. 220 x%=q%-(f%+1)*4+8:z%=10:gosub500:form=466-q%to453+q%-1
  34. 230 pokes%+m,160:pokecs+m,h%:fora=1to5:pokes1+4,33:pokes1+1,m-430
  35. 235 next:next:pokes1+4,32
  36. 240 h%=6:y%=14:z%=11:form=0tog%:x%=q%-m*4+8:gosub500:next:return
  37. 300 u%=0:h%=2:y%=14:ti$="000000"
  38. 310 print" problem";tab(18)"time";tab(30)"right"
  39. 315 printtab(3);pa%+1;tab(31)pr%
  40. 320 form=0tog%
  41. 330 xt%=ti/60:ifxt%>30then return
  42. 340 pokes%+819,asc(mid$(ti$,5,1))+128:pokecs+819,0
  43. 350 pokes%+820,asc(mid$(ti$,6,1))+128:pokecs+820,0
  44. 360 geta$:ifa$=""ora$<"0"ora$>"9"then330
  45. 370 x%=q%-m*4+8:z%=val(a$):gosub500:u%=u%+z%*10^m:next:return
  46. 400 fori=0to12:forj=0to3:fork=0to3:readn%(i,j,k):nextk,j,i
  47. 410 fori=0to5:readp%(i):nexti:forq=1to6:readpi(q),du(q):nextq:return
  48. 500 pokes1+4,33:fori=0to3:forj=0to3:k=t%*y%+x%+t%*j+i
  49. 505 pokes%+k,n%(z%,j,i):pokecs+k,h%:pokes1+1,125-x%*j-y%*i:pokes1,30
  50. 510 nextj,i:pokes1+4,32:return
  51. 1100 data108,226,226,123,225,32,32,97,225,32,32,97,32,226,226,32
  52. 1101 data32,108,97,32,32,126,97,32,32,32,97,32,32,226,226,126
  53. 1102 data108,226,226,123,32,32,98,126,108,226,32,32,124,226,226,126
  54. 1103 data108,226,226,123,32,108,98,126,108,32,32,97,32,226,226,32
  55. 1104 data32,32,254,32,32,255,225,32,124,226,251,126,32,32,124,32
  56. 1105 data225,226,226,126,124,226,127,32,108,32,108,126,32,226,126,32
  57. 1106 data32,255,226,32,225,98,98,32,225,32,32,97,32,226,226,32
  58. 1107 data225,226,226,97,32,32,255,32,32,255,32,32,32,126,32,32
  59. 1108 data108,226,226,123,124,98,98,126,225,32,32,97,32,226,226,32
  60. 1109 data108,226,226,123,124,98,98,97,32,32,108,126,32,226,126,32
  61. 1110 data32,32,123,32,32,98,252,123,32,32,97,32,32,32,32,32
  62. 1111 data160,160,160,97,160,160,160,97,160,160,160,97,160,160,160,97
  63. 1112 data108,123,32,123,124,126,255,32,32,255,108,123,124,32,124,126
  64. 1113 data215,225,231,235,231,235
  65. 1114 data 25,50,33,50,42,50,50,250,42,50,50,300
  66. 19999 s1=54272
  67. 20000 v=s1+24:forl=s1tos1+24:pokes1,0:nextl:pokev,15:pokes1+5,17:pokes1+6,241
  68. 20010 pokes1+4,33:pokes1+1,25:fori=1to50:nexti:pokes1+4,32:fori=1to50:next
  69. 20020 pokes1+1,33:pokes1+4,33:fora=1to50:next:pokes1+4,32:fori=1to50 :next
  70. 20025 pokes1+4,33:pokes1+1,42:fori=1to50:next:pokes1+4,32:fori=1to50:next
  71. 20028 pokes1+4,33:pokes1+1,50:fori=1to250:next:pokes1+4,32:fori=1to50:next
  72. 20030 pokes1+4,33:pokes1+1,42:fori=1to50:nexti:pokes1+4,32:fori=1to50:nexti
  73. 20040 pokes1+4,33:pokes1+1,50:fori=1to300:next:pokes1+4,32
  74. 20050 pokes1+4,33:pokes1+1,66:fori=1to300:next:pokes1+4,32
  75.